% Brief Introduction:
% Cheb1dNode computes the standard Chebychev node.
% This function is simplified from the function written by 
% Paul L. Fackler & Mario J. Miranda.
% Usage:
%   [B]=Cheb1dNode(n,a,b);
% Inputs:
%   n           :    Number of Node Points
%   Bound       :    [Left-end,Right-end] of the Node (Optional)
% OUTPUTS
%   ChebNode    :    Node Vector
%
% Note: without Bound input, normalized node will be returned.
% Author:       Xing Guo, University of Michigan, xingguo@umich.edu
% Version:      Dec 7, 2017   

function ChebNode=Cheb1dNode(n,Bound)

if nargin==1
    ChebNode    =   cos( pi*(0.5+n-1:-1:0.5)'/n );
elseif nargin==2
    a           =   Bound(1);
    b           =   Bound(2);
    ChebNode    =   (a+b)/2+(b-a)/2*cos( pi*(0.5+n-1:-1:0.5)'/n );
end
